<?php

namespace app\admin\model\yunfood;

use addons\yunfood\library\ModelTrait;
use app\admin\model\User;

/**
 * 用户
 */
class SysUser extends User
{
    use ModelTrait;

    // 自定义初始化
    protected static function init()
    {
    }

    // 会员数据
    public function cardUserData()
    {
        return $this->hasOne(\addons\yunfood\model\FundUser::class, 'user_id', 'id');
    }

    // 性别
    const GENDER_MALE   = 1;
    const GENDER_FAMALE = 0;
    const GENDER_NONE   = 2;

    public function getGenderList()
    {
        return [
            self::GENDER_MALE   => __('男'),
            self::GENDER_FAMALE => __('女'),
            self::GENDER_NONE   => __('未设置')
        ];
    }

    // 状态
    const STATUS_NORMAL = 'normal';
    const STATUS_HIDDEN = 'hidden';

    public function getStatusList()
    {
        return [self::STATUS_NORMAL => __('Normal'), self::STATUS_HIDDEN => __('屏蔽')];
    }
}
